From 704750e7ca01e41e1441f442ba6b61d62f0197c4 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 1 Mar 2010 04:19:40 +0000 Subject: [PATCH] Add waypoint read support for Wintec Tes. --- reference/track/wintec_tes~gpx.gpx | 28 ++++++++++++++++++++++++++++ wintec_tes.c | 18 ++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/reference/track/wintec_tes~gpx.gpx b/reference/track/wintec_tes~gpx.gpx index f967fa694..d12cd4ff9 100644 --- a/reference/track/wintec_tes~gpx.gpx +++ b/reference/track/wintec_tes~gpx.gpx @@ -7,6 +7,34 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd"> + + -2.000000 + + WPT001 + WPT001 + WPT001 + + + -1.000000 + + WPT002 + WPT002 + WPT002 + + + 0.000000 + + WPT003 + WPT003 + WPT003 + + + 0.000000 + + WPT004 + WPT004 + WPT004 + diff --git a/wintec_tes.c b/wintec_tes.c index 15c8be552..f5d76f06c 100644 --- a/wintec_tes.c +++ b/wintec_tes.c @@ -75,6 +75,20 @@ wintec_tes_read(void) // The unit of altitude isn't clear and we have a lot of // samples with wildly negative values, so ignore those for now. wpt->altitude = alt; + + // The description given to us says this is a bitmask with + // 0x01 "split mark" (not at all clear what that is) + // 0x02 interest point + // 0x04 track point + // But of the files we've seen, none have had > 1 bit set + // and none have had 0x04 set. + // Wintec's software puts a waypoint in the track, so we + // mock that. + if (flags & 0x02) { + waypoint *temp = waypt_dupe(wpt); + waypt_add(temp); + } + track_add_wpt(trk, wpt); } } @@ -87,8 +101,8 @@ arglist_t wintec_tes_args[] = { ff_vecs_t wintec_tes_vecs = { ff_type_file, { - ff_cap_none /* waypoints */, - ff_cap_read /* tracks */, + ff_cap_read /* waypoints */, + ff_cap_read /* tracks */, ff_cap_none /* routes */ }, wintec_tes_rd_init, -- 2.30.2